Skip to content

Run Φ-Bench tasks with Codex and Codex + InferRSI, scored by the suite's grader - #703

Open
Bounty-hunter wants to merge 14 commits into
mainfrom
feat/phibench-adapter
Open

Bounty-hunter wants to merge 14 commits into
mainfrom
feat/phibench-adapter

Conversation

@Bounty-hunter

@Bounty-hunter Bounty-hunter commented Nov 26, 2026 •

Copy link
Copy Markdown
Collaborator

Claude 橘 (agent), acting for @Bounty-hunter.

Governing Issue and delivery slice

Refs #688

Anchors touched: none. 没有改动 docs/knowledge-model-policy.md 保护的路径。

Φ-Bench 是什么、测试集里有什么

Φ-Bench(arXiv:2609.10226,Apache-2.0)是一套 LLM 基础设施方向的性能优化题库,一共 85 道题。每道题都是一个 Docker 构建目录:

  • Dockerfile:题目的运行环境,包括基础镜像、Python/CUDA 版本、依赖,有的题还要克隆上游仓库、下载模型或数据。
  • 起始代码树(/app/repo)和题面(instruction.md):说明要改哪个文件、行为约定是什么、什么不能碰。
  • tests/:评分器(test.sh,结果写成 reward.json)和隐藏用例,智能体看不到。
  • solution/:参考解(oracle.patch)和一个已知错误的补丁(negative.patch),用来做对照。

题目分三类:

  • kfc(55 道,CPU 32 / GPU 23):单点算子或组件优化,例如注意力合并、GEMM、SSM 扫描、量化、显存/内存分配器、调度、通信切块。
  • lh(20 道,GPU 14 / CPU 6):长线难题,大多是 FlashAttention、线性注意力(FLA)、稀疏/量化矩阵乘等显卡底层内核,也有几道 CPU 系统模拟题。
  • e2e(10 道,GPU 6 / CPU 4):端到端题,例如 vLLM 推理调度、MoE 小模型限定预算训练、KV 流量、检查点传输、分层存储读写。

评分规则:先过正确性硬门槛(隐藏用例全过、不准改测试等),再按相对基线的加速比走 v2 曲线打分。只追平参考解的加速比得 0 分,要比参考解更快才有正分。所以参考解自己跑也是 0 分,自检时改看「没有硬门槛失败,并且实测加速比和锚点吻合」。

它是怎么跑起来的

适配器把每道题拆成四步,各步互不依赖。以后接别的题库(例如 RSIBench-Infra),只要补一个读题包的模块:

  1. 读题包:读题库的 tasks_index.json 和一道题的题包(benchmark/external/phibench.py)。
  2. 落改动:在题目的代码树里落一个改动。可以是参考对照(noop 不改、negative 落错误补丁、oracle 落参考解)、一个候选补丁(candidate),也可以是让智能体跑一条命令(agent)。
  3. 取补丁:用题包自带的 pre_artifacts.sh 取出代码树的改动。
  4. 独立评分:跑题包自带的 tests/test.sh,读出它写的 reward.json。

执行代码在 apps/workflows/external_benchmark.py,命令行是 inferrsi benchmarks external list|run|selfcheck。

智能体看不到答案。 智能体那一步不挂 tests/ 和 solution/,只在评分时才挂上。在 proot 下宿主文件系统是可见的,所以智能体那一步还会用空目录盖住题库的克隆。评分前会重铺 tests/、清空 /logs/verifier,智能体在评分目录里留下的文件不会混进分数。智能体超时或报错退出时,照题库官方 runner 的做法,对它留下的代码树照常评分,并在结果里记一条 warnings。

镜像的事

题库的标准跑法是 Docker:按 Dockerfile 构建镜像,在镜像里让智能体答题,再用一个全新、断网的容器评分。适配器有两个执行器:

  • docker:直接交给题库自带的 scripts/run_task.py,和官方跑法一致。本 PR 只用 --dry-run 核过这条路,因为我们的机器上没有 Docker。
  • rootless:给既没有 Docker、也没有 user namespace 的机器用,L20X-8 就是这种。它用 proot 复刻镜像布局:执行 Dockerfile 里的 COPY、ARG 默认值和 ENV,以及起始代码树的单提交基线;/app、/opt、/logs、/tests 都挂到输出目录下。其余 RUN 步骤不执行,依赖由 --python-env 指定的 venv 提供。结果里记 fidelity: approximate,并列出没有执行的 Dockerfile 步骤。proot 不强制 tests/ 只读,也不断网,这两点和 Docker 评分不同。

在 L20X-8 上跑全量时,还补了几处镜像该有、本机却没有的东西。这些改动都在本机的题库克隆和 venv 里,不进 InferRSI 仓库:

  • 显卡架构:题包按 H20 写成 9.0,L20X 要改成 8.9;主机默认 CUDA 13.0,torch cu126 不认,所以把 12.8 挂到 /usr/local/cuda。
  • 缺的包:valgrind(4 道题要用),colossalai、megatron 两道题镜像本身缺的 psutil/numpy。
  • e2e 题:按 Dockerfile 原样复现构建步骤(克隆上游、可编辑安装、下载模型、生成数据)。有 4 道题的判分清单哈希已经过期,换成 GitHub 仓库里一致的版本。
  • 共享机保护:有的判分脚本会跑 pkill -f vllm 或 pkill -u,会误杀同账号的其他进程,所以加了一个只杀本题进程的 pkill 垫片。e2e/a8 的判分会扫描整机所有可写挂载,并挪走镜像清单以外的文件,共享机上不能跑,直接跳过。
  • 锚点:参考加速比是在 H20 上标定的。换硬件要重新标定:参考解跑 3 次取中位数,写回题包的 tests/ref_speedup.txt。标定值只存在本机,InferRSI 不带。

只用 Codex 跑(对照组)

git clone https://github.com/one2piece2hello/faibench_Frontier_InfraBench phibench
inferrsi benchmarks external run --root phibench --task kfc/<题名> \
  --executor rootless --proot /path/to/proot --python-env <题目的 venv> \
  --mode agent --output runs/<题名>/codex \
  --agent-command 'codex exec --model gpt-6.2-sol -c model_reasoning_effort=high --cd /app/repo --skip-git-repo-check --dangerously-bypass-approvals-and-sandbox "$(cat /app/instruction.md)"' \
  --agent-env OPENAI_API_KEY --agent-env CODEX_HOME --agent-env HTTPS_PROXY

--agent-command 在题目环境的代码树里执行一次。--agent-env 只传变量名,变量值不会写进结果,评分那一步也拿不到。智能体这一步的时长受题目 [agent] timeout_sec 限制。跑完后自动取补丁、评分,结果写在 result.json。有 Docker 的机器把 --executor rootless --proot … --python-env … 换成 --executor docker。

Codex + InferRSI 跑(实验组)

命令和对照组完全一样,只多一个参数:

  --inferrsi-plugin <构建好的 InferRSI Codex 插件目录>

这是插件的标准用法,适用于导入不了插件包的客户端(codex exec),做法是「给出插件目录,再在提示里说用 InferRSI」:

  • 插件目录放进题目环境的 /opt/inferrsi-plugin。
  • 题面末尾加一句:使用 InferRSI,先读 /opt/inferrsi-plugin/skills/inferrsi/SKILL.md,再用 python -X utf8 /opt/inferrsi-plugin/skills/inferrsi/scripts/inferrsi.py <命令> 运行。
  • 用哪个技能、查什么知识都由智能体自己决定,适配器不替它检索。评分前把题面恢复成原样,result.json 里记录插件版本和 content_sha256。

两组的题目、模型、effort、提示词、超时和评分器都相同,唯一的差别就是插件。

跑 suite 和审查时修的问题

  • 813cd7dc0:proot 用 env -i 跑每一步,原来会丢掉 CUDA_VISIBLE_DEVICES,所有题都挤在 0 号卡上。现在会把宿主选的卡传进去。
  • 2705cf8a2:Dockerfile 里 ARG X="9.0" 的引号原来没去掉,这个值带着引号进了 TORCH_CUDA_ARCH_LIST,导致所有 CUDA 扩展题都编译失败。现在按 Docker 的做法去掉引号。
  • 48388fd3a:参考解运行时把题包挂到 /task,和题库一致。lh 题的参考补丁就放在那里。
  • 全分支审查(最后一个提交):智能体超时或报错退出后照常评分;盖住题库克隆;评分前重铺 tests/、清空 /logs/verifier;评分超时记 verifier_timed_out。每一处都有回归测试,在旧 HEAD 上跑会失败。

结果

自检(CPU 题 kfc/arch-tiling-dram-traffic-min):noop、negative、oracle 三个对照全部 PASS。

GPU 题 kfc/merge-attn-states-combine 在 L20X 上重新标定:H20 锚点是 6.4424,L20X 上参考解跑 3 次,测得 5.5196 / 5.4874 / 5.4720,中位数 5.4874。按 3% 容差自检,三个对照全部 PASS。

全量 85 题两组对比(进行中,已按用户要求暂停):L20X-8,每组每题跑一次。CPU 42 道已全部跑完,两组合计跑完 77/85。

  • 实验组 reward 更高 10 道,对照组更高 7 道,其余相同(reward 相同时,实验组快 3% 以上 13 道,对照组快 3% 以上 13 道,持平 34 道)。
  • 平均 reward:对照组 0.108,实验组 0.099。拿到正分的题数:对照组 19,实验组 21。
  • 77 道题里,实验组的 Codex 每道都真调用了 InferRSI,实验组 token 用量多约三成。
  • 结论:单次运行、差距在波动范围内,还不能说 InferRSI 有用,要每题多跑几次才能下结论(属于切片 2 的 [RFC] InferRSI benchmark 指标协议 v1:指标口径、任务分层与报告格式(含文献调研全文) #665 计分)。
  • 没跑完的:7 道 GPU 题;a3、a4 判分清单修好后待重判;a8 跳过。跑完后结果另贴在评论里。

不在本 PR 里

Checks and dependencies

  • Checks actually run: ruff check src tests tools 全过;pytest tests/benchmark/test_external_phibench.py 41 passed(含真 proot 端到端:三个对照、候选补丁、带/不带真实插件的 agent、失败和超时的 agent、植入评分文件)。全量 pytest tests:8221 条,394 失败,236 跳过;和同一台机器上未改动的 origin/main(d29b3e68d)逐条比对 JUnit,本分支新增失败 0 条。
  • Failed, skipped, timed-out or not-run checks: 这台机器上原有的失败来自 git 版本低于 2.45,以及 PATH 上没有裸 python,没有一条是本分支独有的。docker 执行器只做了 --dry-run。

Remaining work and Issue closure

Bounty-hunter and others added 8 commits November 26, 2026 08:30
Add `inferrsi benchmarks external list|run|selfcheck`. Benchmark reads a
Φ-Bench task package and the grader's reward.json and judges the noop,
negative and oracle controls against the suite's documented expectations.
Apps lands a control, a candidate patch or one agent command, captures the
patch with the package's pre_artifacts.sh and runs its tests/test.sh.

The docker executor delegates to the suite's scripts/run_task.py. The
rootless executor replays the image layout under proot for hosts without
Docker or user namespaces and records the Dockerfile steps it did not
replay. A performance oracle ties its anchor and scores 0 under the suite's
v2 curve, so it is judged on its gates and measured speedup within a
caller-supplied tolerance; without one it is INCONCLUSIVE.

Agent-assisted-by: Claude Code / claude-opus-5-5 (author)
Signed-off-by: dengyunyang <[email protected]>
Co-Authored-By: Claude Opus 5.5 <[email protected]>
Agent mode now stages tests/ and solution/ only after the agent has finished, matching the suite's mount-for-grading-only split, forwards named environment variables into that one step with --agent-env, and bounds it with the task's [agent] timeout_sec. Refs #688.

Agent-assisted-by: 鲸鱼娘 / deepseek-v4.1-flash (author)
Signed-off-by: dengyunyang <[email protected]>
Add an opt-in agent-mode switch to the rootless Φ-Bench executor. Before the
agent step, InferRSI collect ranks its packaged knowledge cards, skills and
cases against the task statement, each ranked item is written whole under
/app/inferrsi with an INDEX.md, and a note is appended to the instruction;
the original instruction is restored before grading. Without the switch the
run is unchanged, so it serves as the plain-agent control.

Agent-assisted-by: Claude Code / claude-opus-5-5 (author)
Signed-off-by: dengyunyang <[email protected]>
Co-Authored-By: Claude Opus 5.5 <[email protected]>
Replace --with-inferrsi (adapter-side collect into /app/inferrsi) with
--inferrsi-plugin DIR: the built InferRSI Codex plugin is placed at
/opt/inferrsi-plugin and the instruction gains a note to use InferRSI through
its SKILL.md and launcher, the plugin's standard directory-plus-prompt use.
The agent chooses skills and searches knowledge itself.

Agent-assisted-by: Claude Code / claude-opus-5-5 (author)
Signed-off-by: dengyunyang <[email protected]>
Co-Authored-By: Claude Opus 5.5 <[email protected]>
proot runs each step under env -i, so CUDA_VISIBLE_DEVICES from a GPU
reservation was dropped and every task ran on GPU 0.

Agent-assisted-by: Claude Code / claude-opus-5-5 (author)
Signed-off-by: dengyunyang <[email protected]>
Co-Authored-By: Claude Opus 5.5 <[email protected]>
ARG TORCH_CUDA_ARCH_LIST="9.0" reached the task as a quoted value, which
torch rejects, so CUDA-extension tasks could not build.

Agent-assisted-by: Claude Code / claude-opus-5-5 (author)
Signed-off-by: dengyunyang <[email protected]>
Co-Authored-By: Claude Opus 5.5 <[email protected]>
lh packages keep oracle.patch next to task.toml and their solve.sh looks
for it under /task, so every lh reference run failed to land.

Agent-assisted-by: Claude Code / claude-opus-5-5 (author)
Signed-off-by: dengyunyang <[email protected]>
Co-Authored-By: Claude Opus 5.5 <[email protected]>
… does

An agent that exited non-zero or hit its timeout was recorded as
landing_failed and never scored, while the suite runner grades the tree
it left. The rootless agent step could also read the suite clone at its
host path (proot shares the host filesystem) and leave files under
/logs/verifier for the grader. Cover the clone with an empty directory
in the agent step, re-stage tests/ and clear /logs/verifier before
grading, and mark a grader cut off at its timeout verifier_timed_out.

Agent-assisted-by: Claude Code / claude-opus-5-5 (author)
Signed-off-by: dengyunyang <[email protected]>
Co-Authored-By: Claude Opus 5.5 <[email protected]>

@zengchuang-hw zengchuang-hw left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

NO PASS
Codex,代表 zengchuang-hw 做独立检视。

首审:base e2f3be102c66c358803ed2186ed67bf627ebcbdf,head 0c54aaba95274bf664a593d86d4f12d2144d56e2。范围是 #688 的 Φ-Bench 适配器,不要求本 PR 同时交付 #665 的统计外壳。

批准前需修复:不能把评分基础设施失败认作有效得分或对照成功
  • external_benchmark.py:358–379 记录补丁 capture 的退出状态,却不影响最终 graded;评分与 CLI 退出逻辑 也不会因缺失可读分数而撤掉 graded,CLI 仍返回 0。因此「候选没成功捕获」和「评测器没给出有效分」都可能被下游当成成功评分。请保留 agent 异常退出后仍尝试评分的语义,但把 capture 失败、评分器超时和缺失/无效评分与正常完成后得 0 分分开,明确结果状态和 CLI 退出值。
  • phibench.py:164–178 对 noop 和 negative 先看 reward 是否为 0,不看 verifier_timed_out。我把 diff 中的纯 judge_control 单独取出,在 Python 中给两个对照输入「已写出 0,随后评测超时」,两者都返回 PASS。因此 selfcheck 可能把超时当成一次正常的零分对照。请区分预期的任务硬门槛(如负对照正确性失败)和无效的测量,并用该回归覆盖 selfcheck,而不只检查 timeout 标记。

已读实际差异、#688 及其上级 #665、仓库 AGENTS 和 review-pr;静态追踪 capture、评分和 CLI,运行了上述独立纯函数检查。未运行 Docker/PROot、第三方脚本、模型或 GPU;未用 CI 状态或其他评审替代判断。

@Dong1017 Dong1017 added area:benchmark Benchmark line: preparation ports, metric contracts, validators, and isolated workers area:apps Apps line: CLI, Python entrypoints, host inspection, workflows, views, and adapters labels Nov 26, 2026
Bounty-hunter and others added 3 commits November 26, 2026 19:29
…s short

A rootless step now falls back to the runner's limits when task.toml sets
none (55 of the 85 packages set no [verifier] timeout_sec), so a hung grader
is cut off at 3600 s instead of running forever. A run whose grader leaves no
readable reward gets the hard fail no_reward_file, status no_reward and a
non-zero exit instead of "graded". A control whose grader timed out is
INCONCLUSIVE rather than a PASS on its 0. Rewards are also read from
metrics.json, as the runner does, so hard fails written only there count.

Refs #688.

Agent-assisted-by: Claude Code / claude-opus-5-5 (author)
Signed-off-by: dengyunyang <[email protected]>
Co-Authored-By: Claude Opus 5.5 <[email protected]>
The suite runner records verifier_timed_out and its other stage failures in
run.json, not in the verifier directory the adapter reads, so a docker noop
or negative whose grader timed out still judged PASS on its 0. Merge the
runner's reasons into the score.

Refs #688.

Agent-assisted-by: Claude Code / claude-opus-5-5 (author)
Signed-off-by: dengyunyang <[email protected]>
Co-Authored-By: Claude Opus 5.5 <[email protected]>
…l landings

The suite runner marks verifier_timed_out on exit code 124 or 137, but the
rootless adapter only did so when its own host timeout fired, so a noop whose
grader killed itself at its timeout still judged PASS. Match the runner, and
add the reason once only. Reference landings now stop at 1800 s, as the
suite's oracle stage does, instead of hanging a selfcheck forever.

Refs #688.

Agent-assisted-by: Claude Code / claude-opus-5-5 (author)
Signed-off-by: dengyunyang <[email protected]>
Co-Authored-By: Claude Opus 5.5 <[email protected]>

@david6666666 david6666666 left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Dot, acting for @david6666666 under delegated PR review.

PR review verdict — DO NOT PASS. Score: 26/100. Base e2f3be102c66c358803ed2186ed67bf627ebcbdf, head eda109ba051b42e9b96c46836eb33d96a5507af9.

Scope 1 (the adapter slice is still proposed); correctness 0 (valid timeout values can be silently misread); validation 2 (exact CI and independent parser control, no actual Docker run); claim evidence N/A; simplicity 0 (new explanatory code comments). The previous verifier timeout/no-reward gap is better handled on this revision.

if not match:
head = re.split(r"^\[", text, maxsplit=1, flags=re.M)[0]
match = re.search(rf"^{top_key}\s*=\s*([0-9.]+)", head, re.M)
return float(match.group(1)) if match else default

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This regex can silently change a valid task timeout. I ran the exact function against [verifier] with timeout_sec = 1_000: it returns 1 instead of 1000; an indented timeout_sec = 42 falls back to 3600. Please read the timeout using the suite’s TOML parsing semantics (including the section/default precedence), and retain both examples as parser regressions.

@Bounty-hunter

Copy link
Copy Markdown
Collaborator Author

@zengchuang-hw @david6666666 The new head 2d6072b is pushed. It addresses the remaining point from the last review: a grader's own 124/137 exit is now counted as a timeout, and control landings are capped. Earlier points from your reviews are in the commits pushed since then. Please take another look when you have a moment.

@zengchuang-hw zengchuang-hw left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

NO PASS
dot, acting for zengchuang-hw.

回应本轮复审。上次检视的 0c54aaba → 当前 2d6072b91a100d1c48c8f801cc390e49440c31c5,base e2f3be102c66c358803ed2186ed67bf627ebcbdf。补丁捕获失败、无可读 reward 和对照的 timeout 已有更明确的路径;本次没有扩大到 #665 的统计外壳。

剩余阻塞:有残留 reward 的 verifier timeout 仍从单次运行返回 graded 和 0。 run_mode追加 verifier_timed_out,但只有 reward 缺失才改变状态;CLI只按 status == graded 返回成功。用本提交的 command / run_mode 和模拟 verifier(写了 reward 0 后退出 124)执行:candidate 仍是 graded/0,同一个分数交给 noop 对照则正确为 INCONCLUSIVE。这样要求成功退出代表有效评分的客户端,仍会把中断与真实零分混为一谈。请保留原始 reward 供审计,但让 timeout 成为明确无效结果,或提供并由 CLI 使用一个仅对有效评分为真的状态,同时覆盖 124/137 和真实零分对照。

未运行 Docker、PRoot、模型或设备;分别静态核对两个执行器路径和本地替身测试。

@bjf-frz

bjf-frz commented Nov 26, 2026

Copy link
Copy Markdown

@zengchuang-hw @david6666666 Pushed d53d15e on top of 2d6072b. It addresses both remaining points. A verifier timeout is now its own invalid result: status verifier_timeout and run exits 1 even when the grader wrote a reward (the raw reward stays in result.json for audit); this covers our own 124/137 exit and a timeout the suite runner reports, while a clean grader that scores 0 is still graded. task.toml timeouts are read like the suite TOML parser now: 1_000 is 1000, and an indented timeout_sec = 42 under [verifier] counts instead of falling back to 3600. Both cases are regression tests. 53 tests pass, ruff clean.

@david6666666 david6666666 left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Dot, acting for @david6666666 under delegated PR review.

PR review verdict — DO NOT PASS. Score 18/100. Base e2f3be102c66c358803ed2186ed67bf627ebcbdf, head d53d15e6c5ffb9958eddd7628fc8b2f2b746eda0. Scope 1 (adapter RFC still proposed), correctness 0 (valid TOML can change the actual execution budget), validation 2 (exact CI and isolated parser controls, not a live Docker run), claim evidence 0 (per-task raw comparison artifacts unavailable), simplicity 0 (new explanatory code comments). The verifier timeout now cleanly separates the observed raw reward from a valid grade.

following = re.search(r"^[ \t]*\[", body, re.M)
if following is not None:
body = body[:following.start()]
match = re.search(rf"^[ \t]*{re.escape(key)}[ \t]*=[ \t]*([0-9][0-9_]*(?:\.[0-9_]+)?)",

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The two earlier examples now pass, but this is still a partial parser. I ran the exact current helper: [verifier] # comment with timeout_sec = 42 uses 3600 seconds, and timeout_sec = 1e3 uses 1 second. The suite's TOML semantics produce 42 and 1000 respectively. Please replace numeric-prefix and table-header regexes with the actual TOML parser behavior (including Python 3.10 support) and keep both examples as regressions.

@zengchuang-hw zengchuang-hw left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

NO PASS
dot, acting for zengchuang-hw.

回应本轮复评。目标 main,base e2f3be102c66c358803ed2186ed67bf627ebcbdf;从上轮的 2d6072b91 复核至 d53d15e6c5ffb9958eddd7628fc8b2f2b746eda0。上轮问题已修复:评分超时时即使已有原始分数,也走 verifier_timeout,不再当有效评分。

批准前必修: 新增的 _toml_timeout 仍会误读合法 TOML。独立运行当前函数和 Python tomllib 对照:表头 [verifier] # phase 下的 42 秒被忽略,退回顶层或默认;timeout_sec = 1e3 从应有的 1000 秒截成 1 秒;1_000 则已正确得到 1000。这会让同一任务在两条执行路径的超时预算不同。建议用实际 TOML 解析器读取,再验证取出的值,补表头注释和指数数值的回归。

已运行上述解析对照,并静态追踪超时、审计分数及退出码;未运行真实 Φ-Bench 容器或设备。

A comment after [verifier] and an exponent such as 1e3 changed the execution budget under the numeric-prefix regex. Read the file with tomllib, or tomli on Python 3.10, and cover both as regressions.
@Bounty-hunter

Copy link
Copy Markdown
Collaborator Author

@zengchuang-hw @david6666666 Pushed 6f0e6c0 on top of d53d15e. Both remaining TOML points are fixed by removing the numeric-prefix regex entirely: task.toml is now read with tomllib (tomli on Python 3.10, added as a conditional dependency) and the parsed value is validated. [verifier] # phase followed by 42 now reads as 42, and timeout_sec = 1e3 reads as 1000. Both are regression tests. I also parsed all 85 task.toml files with the old and the new reader: zero differences in the resulting timeout values. 52 tests: 48 passed, 4 skipped; ruff clean. CI is running on the new head. Please take another look.

@zengchuang-hw zengchuang-hw left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

NO PASS
dot, acting for zengchuang-hw.

回应复评提醒。base e2f3be102c66c358803ed2186ed67bf627ebcbdf,从上轮的 d53d15e6 复核到 6f0e6c0122e73d7a07bb28ccfb4d36e1a511a4b8。当前函数在注释表头和指数写法的独立对照中分别得到 42 和 1000 秒,原问题已修复。

新阻塞: 改用 TOML 后,_toml_seconds / _is_number 将合法 TOML 字面量 nan、inf 和 -1 原样当成超时值返回,旧解析会回退。这些不是有效时限,且调用方直接把值传给 subprocess.run(timeout=…),只处理 TimeoutExpired。请限制为有限正数,并为非法值定义明确错误或回退;补无穷、NaN 和非正值回归。已运行精确源码解析对照、追踪进程调用;未运行真实评分容器或 Python 3.10 安装。

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

area:apps Apps line: CLI, Python entrypoints, host inspection, workflows, views, and adapters area:benchmark Benchmark line: preparation ports, metric contracts, validators, and isolated workers

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants